#pragma once
#include "GrsView.h"
#include "Grs.h"
class OceanGrsView:public GrsView
{
public:
	virtual void drawGrs(CGrs* grs, CPaintDC* dc)
    { 
		CGdiObject *oldBrush = dc->SelectStockObject(DC_BRUSH);
		CGdiObject *oldPen = dc->SelectStockObject(DC_PEN);
		if(grs->getState()==CGrs::NORMAL_STATE)
		{
			dc->SetDCBrushColor(RGB(0,255,0));
		}
		else if(grs->getState()==CGrs::CRITICAL_STATE)
		{
			dc->SetDCBrushColor(RGB(255,0,0));
		}
		else if(grs->getState()==CGrs::WARNING_STATE)
		{
			dc->SetDCBrushColor(RGB(255,255,0));
		}
		dc->SetDCPenColor(RGB(0,0,0));
		dc->Ellipse(grs->getPosition()->x-10,grs->getPosition()->y-10,grs->getPosition()->x+10,grs->getPosition()->y+10);
		dc->SelectObject(oldBrush);
		dc->SelectObject(oldPen);


		dc->TextOut(grs->getPosition()->x-10, grs->getPosition()->y-25, grs->getName().data());
		
		 char* str = new char[30];
		 sprintf(str, "%.i", grs->getInAmount());  
		 char* str1= new char[30];
		 sprintf(str1, "%.i", grs->getOutAmount());  
		 
		  
        dc->TextOut(grs->getPosition()->x-10, grs->getPosition()->y+10, str);
		dc->TextOut(grs->getPosition()->x-10, grs->getPosition()->y+25, str1);

    }
	OceanGrsView(void);
	~OceanGrsView(void);
};

